import myAxios from "../plugins/myAxios.ts";
import {setCurrentState} from "../global/user.ts";

export const getCurrentUser = async () => {
    const res = await myAxios.get('/userInfo/currentUser')
    if (res.code === 0) {
        setCurrentState(res.data)
        const user: UserInfo = res.data
        return user
    }
    return null;
}